#! /usr/bin/env python 
#coding:utf-8

class PageInfo(object):

	def __init__(self,current,totalNum,peritems=10):
		self.__current = current
		self.__totalNum = totalNum
		self.__peritems = peritems

	def currentPage(self):
		pageNum = list(divmod(self.__totalNum,self.__peritems))
		# return pageNum[]
		if pageNum[1] < self.__peritems :
			pageNum[0] = pageNum[0] + 1
		return pageNum

	def From(self):
		return (self.__current - 1) * self.__peritems 
		

	def To(self):
		return self.__current * self.__peritems